<template>
  <div>
    <header class="header">
      <span v-if="$route.meta.back" class="back" @click="$router.go(-1)">返回</span>
      <div class="text">{{$route.meta.title}}</div>
      <router-link to="/register" v-if="$route.meta.register" class="register">注册</router-link>
    </header>
    <router-view class="con"></router-view>
    <!-- <router-view class="second-view" name="second"></router-view> -->
  </div>
</template>

<script>
export default {
  updated(){
    console.log(this.$route.meta.title);
  }
};
</script>

<style lang="less" scoped>
@import "./less/index.less";
.con {
  padding-top: 0.6rem;
  color:#fff;
}
.header {
  width: 100vw;
  height: 0.6rem;
  background:@primary-light;
  position: fixed;
  left: 0;
  top: 0;
    color:#fff;
}
.back {
  position: absolute;
  left: 0.2rem;
  line-height: 0.6rem;
    color:#fff;
}
.text {
  width: 100%;
  line-height: 0.6rem;
  text-align: center;
    color:#fff;
    font-size: @font-h2;
}
.register {
  position: absolute;
  top:0;
  right: 0.2rem;
  line-height: 0.6rem;
    color:#fff;
}
</style>